<?php
define('APPMADEGROUPS','1.00');
/************************************************************************/
/* FrameWork  test preview                                              */
/* ==================================================================== */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

//----------------------------------------------------------------------------------------------------------------------
$data_groups=$_POST['data_groups'];

function madegroups($data_groups,$container,$subapp){
    admin_writelog("admin madegroups:delete group ".$data_groups);
    group_delete($data_groups);
    if ($_POST['data_groups']){
	echo "Groups Delete ...done <br />";
    }
    echo "<hr />";
    echo "Gruppo: <a>$data_groups</a> Cancellato !!!\n";
}
//-----------------------------------------------------------------------------------------------------------------------

//carica la lingua se esiste
$lang=lang();
//if (file_exists("applications/$appname/lang/$lang.inc"))
//    include "applications/$appname/lang/$lang.inc";
//else
//    include "applications/$appname/lang/it.inc";


// DELE-GROUPS
$listuser=user_listusers();
$listgroups=group_listgroups();

    echo "<b>GRUPPI ESISTENTI</b><BR><BR>";
    foreach( $listgroups as $selgroup){
	if($selgroup!=$group)
	    echo "$selgroup<br/>";
    }

?>
<?php if (admin_isadmin()){?>
        <h3>Dele Groups</h3><hr />
	<p>
<?php

$op=$_GET['op'];
switch ($op){
    case "madegroups":
	madegroups($data_groups,$container,$subapp);
	echo "<p align='right'> [<a href='index.php?appname=$appname'>continua</a>]</p>\n";
	break;
    default:
?>
<form action="index.php?appname=<?=$appname?>&op=madegroups" method="post">
<b>INSERISCI IL GRUPPO DA ELIMINARE (SOLO SE SEI SICURO - NESSUNA CONFERMA !!!)</b><br/>
<INPUT size="50" type="text" name="data_groups" maxlength="30"/>  <br />
<br />
<hr />
<input type='submit' value=' delete group ' />
</form>
<?php
    break;
    }
?>
</p>
<?php  } ?>
